package cn.dmw.controller;

import cn.dmw.dto.PassengerPhoneDTO;
import cn.dmw.service.VerifiPassengerService;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class VerifiPassengerController {
    @Autowired
    VerifiPassengerService verifiPassengerService;

    @GetMapping("/getPassengerPhone")
    //@RequestBody PassengerPhoneDTO passengerPhone
    //@RequestParam String passengerPhone
    public String getPassengerPhone(@RequestParam String passengerPhone){
        System.out.println("getPassengerPhone : "+ passengerPhone);
        JSONObject passengerPhoneRes=JSONObject.fromString(verifiPassengerService.verifiPassengerInfo(passengerPhone)) ;
        System.out.println(passengerPhoneRes.toString());
        return passengerPhoneRes.toString();
    }
}
